---
layout: m1x_soap
title: Account List
---

<h3><a name="giftcard_account.list-Module%3AGiftCardAPI"></a>Module: GiftCard API</h3>

<h4><a name="giftcard_account.list-Resource%3Agiftcardaccount"></a>Resource: giftcard_account</h4>


<h5><a name="giftcard_account.list-Method%3A"></a>Method:</h5>

<ul>
	<li>giftcard_account.list (SOAP V1)</li>
	<li>giftcardAccountList (SOAP V2)</li>
</ul>


<p>Allows you to retrieve the list of available gift card accounts.</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> array </td>
<td> filters </td>
<td> Array of filters (optional) </td>
</tr>
</tbody></table>


<p><b>Return:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> array </td>
<td> result </td>
<td> Array of giftcardAccountEntity </td>
</tr>
</tbody></table>


<p>The <b>giftcardAccountEntity</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> int </td>
<td> giftcard_id <br class="atl-forced-newline" /> </td>
<td> Gift card ID </td>
</tr>
<tr>
<td> string </td>
<td> code <br class="atl-forced-newline" /> </td>
<td> Gift card code </td>
</tr>
<tr>
<td> int </td>
<td> store_id <br class="atl-forced-newline" /> </td>
<td> Gift card store ID </td>
</tr>
<tr>
<td> string </td>
<td> date_created <br class="atl-forced-newline" /> </td>
<td> Creation date in the YYYY-MM-DD format <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string </td>
<td> expire_date <br class="atl-forced-newline" /> </td>
<td> Expiration date in the YYYY-MM-DD format <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> int </td>
<td> is_active <br class="atl-forced-newline" /> </td>
<td> Defines whether the gift card is active </td>
</tr>
<tr>
<td> string </td>
<td> status <br class="atl-forced-newline" /> </td>
<td> Gift card status </td>
</tr>
<tr>
<td> double </td>
<td> balance <br class="atl-forced-newline" /> </td>
<td> Gift card balance </td>
</tr>
</tbody></table>


<p><b>Faults:</b></p>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 101 </td>
<td> Invalid filters specified. Details in error message. </td>
</tr>
</tbody></table>


<h4><a name="giftcard_account.list-Examples"></a>Examples</h4>

<h5><a name="giftcard_account.list-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

$giftcardList = $proxy-&gt;call(
    $sessionId,
    "giftcard_account.list"
);</pre>
		</div>
</div></div>

<h5><a name="giftcard_account.list-RequestExampleSOAPV2%28ListofAllGiftCardAccounts%29"></a>Request Example SOAP V2 (List of All Gift Card Accounts)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy-&gt;giftcardAccountList($sessionId);
var_dump($result);</pre>
		</div>
</div></div>

<h5><a name="giftcard_account.list-RequestExampleSOAPV2%28ComplexFilter%29"></a>Request Example SOAP V2 (Complex Filter)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

// If some stuff requires API authentication,
// then get a session token
$session = $client-&gt;login('apiUser', 'apiKey');
$complexFilter = array(
    'complex_filter' =&gt; array(
        array(
            'key' =&gt; 'state',
            'value' =&gt; array('key' =&gt; 'in', 'value' =&gt; '2,1')
        )
    )
);
$result = $client-&gt;giftcardAccountList($session, $complexFilter);

var_dump ($result);</pre>
		</div>
</div></div>



<h5><a name="giftcard_account.list-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey')); 
 
$result = $proxy-&gt;giftcardAccountList((object)array('sessionId' =&gt; $sessionId-&gt;result, 'filters' =&gt; null));   

var_dump($result-&gt;result);</pre>
		</div>
</div></div>




<h5><a name="giftcard_account.list-ResponseExampleSOAPV1"></a>Response Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">array
  0 =&gt;
    array
      'giftcard_id' =&gt; string '1' (length=1)
      'code' =&gt; string 'code' (length=12)
      'store_id' =&gt; string '2' (length=1)
      'date_created' =&gt; string '2012-04-06' (length=10)
      'expire_date' =&gt; string '2012-04-22' (length=10)
      'is_active' =&gt; string '0' (length=1)
      'status' =&gt; string 'Available' (length=9)
      'balance' =&gt; string '300.0000' (length=8)
  1 =&gt;
    array
      'giftcard_id' =&gt; string '2' (length=1)
      'code' =&gt; string 'code' (length=12)
      'store_id' =&gt; string '2' (length=1)
      'date_created' =&gt; string '2012-04-09' (length=10)
      'expire_date' =&gt; string '2012-04-25' (length=10)
      'is_active' =&gt; string '1' (length=1)
      'status' =&gt; string 'Available' (length=9)
      'balance' =&gt; string '500.0000' (length=8)</pre>
		</div>
</div></div>


